<?php /* Smarty version Smarty-3.1.12, created on 2013-03-03 19:50:51
         compiled from "D:\wamp\www\acps_new\templates\users\edit-technic.tpl" */ ?>
<?php /*%%SmartyHeaderCode:243425133a529064e92-38487008%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '219a023f4334419977449a06fa5468e0eb2a9b16' => 
    array (
      0 => 'D:\\wamp\\www\\acps_new\\templates\\users\\edit-technic.tpl',
      1 => 1362340235,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '243425133a529064e92-38487008',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_5133a52920f941_30127494',
  'variables' => 
  array (
    'data' => 0,
    'client' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5133a52920f941_30127494')) {function content_5133a52920f941_30127494($_smarty_tpl) {?><ul class="subNavig">
    <li><a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=list_of_clients">Clients</a></li>
    <li><a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=list_of_users">Users</a></li>
</ul>
<?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<script type="text/javascript">
    
        
    $(document).ready(function() {
        $(".float").change(function() {
            makeFloat(".float");
        });
        $("#associatedClients").multiselect(); 
    });
    
</script>
<h2 class="pageTitle">Edit user</h2>

<form class="adding" action="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=edit_user&user=<?php echo $_REQUEST['user'];?>
" method="post" onsubmit="return checkAdd_user(
                                                                    $('#name').val(),
                                                                    $('#surname').val(),
                                                                    $('#login').val(),
                                                                    preprocessPassword('#password'),
                                                                    $('#client').val(),
                                                                    $('#userlevel').val(),
                                                                    $('input:radio[name=user[active]]:checked').val())
                                                                    ">
    <table class="tableForm">
        <tr>
            <td>
                <label for="name">Name <span class="red">*</span> </label>
            </td>
            <td>
                <input name="user_data[name]" id="name" type="text" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['user_data']['name'];?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="surname">Surname<span class="red">*</span> </label>
            </td>
            <td>
                <input name="user_data[surname]" id="surname" type="text" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['user_data']['surname'];?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="email">Email<span class="red"></span> </label>
            </td>
            <td>
                <input name="user_data[email]" id="email" type="text" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['user_data']['email'];?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="telephone">Telephone<span class="red"></span> </label>
            </td>
            <td>
                <input name="user_data[telephone]" id="telephone" type="text" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['user_data']['telephone'];?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="login">Login<span class="red">*</span> </label>
            </td>
            <td>
                <input name="user_data[login]" id="login" type="text" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['user_data']['login'];?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="password">Password<span class="red">*</span> </label>
            </td>
            <td>
                <input name="user_data[password]" id="password" type="password" />&nbsp;<label class="hide" for="passwordShort">This password is short (min. 6 chars)!</label>
            </td>
        </tr>
        <tr>
            <td>
                <label for="client">Client<span class="red">*</span> </label>
            </td>
            <td>
                <input name="user_data[userlevel]" id="userlevel" value="1" type="hidden" />
                <select name="user_data[client]" size="1" id="client">
                    <option value="">Please select</option>
                    <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['clients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['client']->key;
?>
                        <option <?php if ($_smarty_tpl->tpl_vars['client']->value['klient_id']==$_smarty_tpl->tpl_vars['data']->value['user_data']['client']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['client']->value['klient_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['client']->value['name'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr <?php if ($_smarty_tpl->tpl_vars['data']->value['user_data']['userlevel']==@USER_TYPE_CLIENT){?>style="display: table-row;"<?php }else{ ?>style="display: none;"<?php }?> id="associatedClientsForm">
            <td>
                <label for="associatedClients">Associated clients<span class="red"></span> </label>
            </td>
            <td>
                <select name="user_data[associatedClients][]" size="10" id="associatedClients" multiple="" style="width: 500px">
                    <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['clients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['client']->key;
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['client']->value['klient_id'];?>
" <?php if (in_array($_smarty_tpl->tpl_vars['client']->value['klient_id'],$_smarty_tpl->tpl_vars['data']->value['user_data']['associatedClients'])&&($_smarty_tpl->tpl_vars['client']->value['klient_id']!=$_smarty_tpl->tpl_vars['data']->value['user_data']['client'])){?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['client']->value['name'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="active">Active<span class="red">*</span> </label>
            </td>
            <td>
                <input name="user_data[active]" type="radio" value="1" <?php if (1==$_smarty_tpl->tpl_vars['data']->value['user_data']['active']){?>checked="checked"<?php }?> /> Yes <br/>
                <input name="user_data[active]" type="radio" value="0" <?php if (0==$_smarty_tpl->tpl_vars['data']->value['user_data']['active']){?>checked="checked"<?php }?>/> No
            </td>
        </tr>
        <tr class="submitRow">
            <td>
                <input name="action" value="edit_user" type="hidden" />
            </td>
            <td>
                <input type="submit" value="Edit user" name="edit_user" /> &nbsp; 
                <span class="red">* Required</span>
            </td>
            <td></td>
        </tr>
    </table>
</form><?php }} ?>